package com.itheima.reggie.mapper;

import com.itheima.reggie.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface DishFlavorMapper {
    //插入多条口味数据
    Integer save(@Param("dishFlavorlists") List<DishFlavor> dishFlavorlists);
    //删除菜品对应的口味列表
    @Delete("delete from dish_flavor where dish_id = #{dishId}")
    Integer delete(Long dishId);
    //根据菜品id查询口味列表数据
    @Select("select * from dish_flavor where dish_id = #{dishId}")
    List<DishFlavor> findByDishId(Long dishId);

}
